const api = require("../../utils/interface.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    memberCardId:"",
    stationId:'',
    productId_:'',
    nums:2,
    userInfo:{}
  },
  onLoad: function (options) {
    let user2 = wx.getStorageSync('userInfo')
    api.getMemberInfo({ id: user2.id }).then(res => {
      if(!res.data.result.phone){
        wx.redirectTo({
          url: '/pages/login/login?page=' + page,
        })
        return false
      }
      console.log(res.data.result)
      this.setData({userInfo:res.data.result})
    })
    console.log(options)
    this.setData({
      memberCardId: options.memberCardId,
      stationId: options.stationId,
      productId_: options.parductId
    })
    var pages = getCurrentPages();
    var prevPage = pages[pages.length - 2];
    prevPage.setData({
      isShow: false
    })
  },
})